{extend name="property/public/insidePageBase" /}
{block name="title"}编辑维修工单分类{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label class="layui-form-label">上级分类</label>
                <div class="layui-input-block">
                    <input type="text" name="pid" id="mer_category" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">分类图标</label>
                <div class="layui-input-inline">
                    <input type="text" name="picture" value="{$info['picture']}"  placeholder="请上传分类图标" id="picture" class="layui-input">
                </div>
                <img src="{$info['picture']??''}" class="checkPictureByImg picture" style="width: 80px;height: 40px;">
                <div class="layui-input-inline layui-btn-container" style="width: auto;">
                    <button type="button" class="layui-btn layui-btn-primary uploadImg" lay-data="{field: 'picture',data:{dir:'asset/cate', field:'picture'}}">
                        <i class="layui-icon">&#xe67c;</i>
                    </button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">分类名称</label>
                <div class="layui-input-block">
                    <input type="text" name="cate_name" value="{$info['cate_name']}" placeholder="请输入分类名称" class="layui-input" lay-verify="required" autocomplete="off"/>
                </div>
            </div>
            <div class="layui-form-item" pane="">
                <label class="layui-form-label">工单属性</label>
                <div class="layui-input-block">
                    <input type="radio" name="time_type" autocomplete="off" value="1" title="紧急不重要" {if $info['time_type'] == 1}checked{/if}>
                    <input type="radio" name="time_type" autocomplete="off" value="2" title="重要不紧急" {if $info['time_type'] == 2}checked{/if}>
                    <input type="radio" name="time_type" autocomplete="off" value="3" title="重要且紧急" {if $info['time_type'] == 3}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline"> <label class="layui-form-label">工单限时</label>
                    <div class="layui-input-block">
                        <input type="text" name="time_limit"  value="{$info['time_limit']}" placeholder="工单限时完成时长【H】"  class="layui-input" lay-verify="number" >
                    </div>
                </div>
                <div class="layui-inline"> <label class="layui-form-label">工单价格</label>
                    <div class="layui-input-block">
                        <input type="number" name="amount" value="{$info['amount']}" placeholder="请输入工单价格" class="layui-input" lay-verify="number" autocomplete="off"/>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" pane="">
                <label class="layui-form-label">是否显示</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_show" autocomplete="off" value="1" title="开启" {if $info['is_show'] == 1}checked{/if}>
                    <input type="radio" name="is_show" autocomplete="off" value="2" title="隐藏" {if $info['is_show'] == 2}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn" lay-submit lay-filter="submitBtn" id="submitBtn">提交</button>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
{__block__}
<script>
    layui.use([ 'form', 'layer', 'layCascader'], function () {
        var form = layui.form,layer = layui.layer,$ = layui.$,layCascader = layui.layCascader;
        $('.uploadImg').selectImages({
            confirm:function(res,elem,data) {
                $('#' + data.field).val(res[0].src);
                $('.' + data.field).attr('src',res[0].src)
            }
        });
        let merCategory = layCascader({
            elem: '#mer_category',
            value: {$info['pid']??'0'},
            placeholder:'顶级分类',
            props: {
                checkStrictly: true
            },
            options: {:json_encode($cateNameData,JSON_UNESCAPED_UNICODE)}
        });
    });
</script>
{/block}